package day07;

import day03.IfDemo;
import day04.ForDemo;
import org.w3c.dom.ranges.DocumentRange;

import javax.lang.model.type.TypeKind;
import javax.swing.*;
import java.util.Random;
import java.util.Scanner;
import java.util.zip.DeflaterOutputStream;

public class HomeWord1 {
    public static void main(String[] args) {
        Scanner scan= new Scanner(System.in);
        int num= (int)(Math.random()*1000+1);
        System.out.println(num);
        while (true){
            System.out.println("caiba");
            int g=scan.nextInt();
            if (g>num){
                System.out.println("dale");
            }else if (g<num){
                System.out.println("xiaole");
            }else{
                System.out.println("gongxi");
                break;
            }
        }
        String co= ad(4);
        System.out.println("验证码为："+co);




    }
    public static String ad(int len){
        String co="";
        char[] chs = {'a','b','c','d','e','f','g','h','i','j','k',
                'l','m','n','o','p','q','r','s','t','u','v',
                'w','x','y','z','A','B','C','D','E','F','G',
                'H','I','J','K','L','M','N','O','P','Q','R',
                'S','T','U','V','W','X','Y','Z','0','1','2',
                '3','4','5','6','7','8','9'};
        Random rand= new Random();
        for (int i=1;i<=len;i++){
            int index = rand.nextInt(chs.length);
            co+=chs[index];
        }
        return co;
    }

}
